x86: fix domain cleanup
authorJan Beulich <jbeulich@suse.com>
Fri, 29 Apr 2016 16:30:22 +0000 (18:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 29 Apr 2016 16:30:22 +0000 (18:30 +0200)
commita29e895b2bde17ab239da3bff76ec00c8d9b2e77
tree45c53a084e261ac645e978b7502bf1d4b0e7054b
parent854c6aab46dec23573ca7dc1a4a03674d2ec63d5
x86: fix domain cleanup

Free d->arch.cpuids on both the creation error path and during
destruction.

Don't bypass iommu_domain_destroy().

Move psr_domain_init() up so that hvm_domain_initialise() again is the
last thing which can fail, and hence doesn't require undoing later on.

Move psr_domain_free() up on the creation error path, so that cleanup
once again gets done in reverse order of setup.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/domain.c